package com.example.utils;

import com.example.model.CargoRequest;

import java.util.List;

public class processCargoData {
    // 给每个货物对象加上 cargoCode 货物编码
    public static void addCargoCode(CargoRequest cargoRequest) {
            String cargoCategory = cargoRequest.getCargoCategory();
            double vehicleWeight = cargoRequest.getVehicleWeight();

            // 根据货物类别和重量设置货物编码
            if (cargoCategory.contains("管材")) {
                cargoRequest.setCargoCode("GC");
            } else if (cargoCategory.contains("危")) {
                cargoRequest.setCargoCode("WHP");
            } else if (cargoCategory.equals("食")) {
                cargoRequest.setCargoCode("SPX");
            } else if (vehicleWeight >= 6) {
                cargoRequest.setCargoCode("ZH");
            } else {
                cargoRequest.setCargoCode("PT");
            }

    }
}